<template>
  <div>
    <song-data
    :songData="{ operation: '操作', name: '音乐标题', singer: '歌手', album: '专辑', duration: '时长' }"
    :isTitle="true"/>
    <song-data
      v-for="(item, index) in songs"
      :key="index"
      :songData="item"
      :index="index + 1"
      ref="songDataRef"
      @cancelActive="cancelActive"/>
  </div>
</template>

<script>
import SongData from 'components/content/songlist/SongData.vue'

export default {
  name: 'ResultSong',
  props: {
    songs: {
      type: Array,
      default () {
        return []
      }
    }
  },
  components: {
    SongData
  },
  methods: {
    // 1. 取消选中
    cancelActive () {
      this.$refs.songDataRef.forEach(item => {
        item.cancelActive()
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
